<div data-ng-controller="RegisterCtrl">
    <div ng-repeat="error in registerError">
        <div class="alert alert-danger animated fadeIn">{{error.msg}}</div>
    </div>
    <div class="alert alert-danger animated fadeIn" ng-show="usernameError">{{usernameError}}</div>

    <h1>Register</h1>
    <form ng-submit="register()" class="signup form-horizontal">
        <div class="form-group">
            <label for="name" class="col-md-4 control-label">全名</label>
            <div class="col-md-8">
                <input id="name" type="text" name="name" placeholder="全名" class="form-control" ng-model="user.name"/>
            </div>
        </div>
        <div class="form-group">
            <label for="email" class="col-md-4 control-label">邮件地址</label>
            <div class="col-md-8">
                <input id="email" type="email" name="email" placeholder="邮件地址" class="form-control" ng-model="user.email"/>
            </div>
        </div>
        <div class="form-group">
            <label for="username" class="col-md-4 control-label">用户名</label>
            <div class="col-md-8">
                <input id="username" type="text" name="username" placeholder="用户名" class="form-control" ng-model="user.username"/>
            </div>
        </div>
        <div class="form-group">
            <label for="password" class="col-md-4 control-label">密码</label>
            <div class="col-md-8">
                <input id="password" type="password" name="password" placeholder="密码" class="form-control" ng-model="user.password"/>
            </div>
        </div>
        <div class="form-group">
            <label for="confirmPassword" class="col-md-4 control-label">确认密码</label>
            <div class="col-md-8">
                <input id="confirmPassword" type="password" name="confirmPassword" placeholder="确认密码" class="form-control" ng-model="user.confirmPassword"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-offset-4 col-md-8">
                <button type="submit" class="btn btn-primary">注册</button>&nbsp;
                or&nbsp;<a ui-sref='auth.login' class="show-login">登录</a>
            </div>
        </div>
    </form>
</div>
